<?php

namespace app\admin\model\project;

use think\Model;

/**
 * Project
 */
class Project extends Model
{
    // 表名
    protected $name = 'project';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;

    // 字段类型转换
    protected $type = [
        'expire_time' => 'timestamp:Y-m-d H:i:s',
    ];


    public function custom(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\Custom::class, 'custom_id', 'id');
    }

    public function projectCate(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\project\Cate::class, 'project_cate_id', 'id');
    }
}